// 导入axios实例
import httpRequest from "../axios";
//增加Form
interface Form {
    storyTitle: string;
    humorTitle: string;
    storySite: string;
    storyDate: Date;
    storyFirst: string;
    storySecond: string;
    storyThird: string;
    storySummary: string;
    storyImg1: string;
    storyImg2: string;
    storyImg3: string;
    views: number;
    focus: number;
}
//修改Form
interface Form2 {
    id: number;
    storyTitle: string;
    humorTitle: string;
    storySite: string;
    storyDate: Date;
    storyFirst: string;
    storySecond: string;
    storyThird: string;
    storySummary: string;
    storyImg1: string;
    storyImg2: string;
    storyImg3: string;
    views: number;
    focus: number;
}
let pageNow:number;
//查询全部
export function allGet(pageNow) {
    return httpRequest({
        url: "/index/get/indexMyStory?pageNow="+pageNow,
        method: "get"
    });
}
//查询重要全部
export function allGetI(pageNow) {
    return httpRequest({
        url: "/index/get/indexMyStoryI?pageNow="+pageNow,
        method: "get",
    });
}
//根据id查询单个
export function getOne(id) {
    return httpRequest({
        url: "/index/get/indexMyStory/" + id,
        method: "get",
    });
}
//根据搜索内容进行查询
export function getCon(Con) {
    return httpRequest({
        url: "/queryStory/" + Con,
        method: "get",
    });
}
//根据搜索重要内容进行查询
export function getConI(Con) {
    return httpRequest({
        url: "/queryStoryI/" + Con,
        method: "get",
    });
}
//查询多少页
export function getPage() {
    return httpRequest({
        url: "/index/get/indexMyStory/pageAll",
      method: "get",
    });
}
//查询重要事件多少页
export function getPageI() {
    return httpRequest({
        url: "/index/get/indexMyStoryI/pageAll",
      method: "get",
    });
}
//增加一个
export function AddG(param: Form) {
    return httpRequest({
        url: "/index/post/addStory",
        method: "post",
        data: param,
    });
}
//删除一个
export function DeleteG(id) {
    return httpRequest({
        url: "/index/get/deleteStory/" + id,
        method: "get",
    });
}
//修改一个
export function EditG(param: Form2) {
    return httpRequest({
        url: "/index/post/editStory",
        method: "post",
        data: param,
    });
}
